package com.wondream.rabbitmq.consumer.handler;

import com.rabbitmq.client.Channel;
import com.wondream.rabbitmq.consumer.config.RabbitmqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author wondream
 * @version 1.0
 * @create 2022/5/8 6:07 PM
 */
@Component
public class ReceiveHandler {

    @RabbitListener(queues = {RabbitmqConfig.QUEUE_TOPIC_INFORM_EMAIL})
    public void handleEmailMessage(String msg, Message message, Channel channel){
        System.out.println("receive message email inform "+msg);
    }

    @RabbitListener(queues = {RabbitmqConfig.QUEUE_TOPIC_INFORM_SMS})
    public void handleSmsMessage(String msg, Message message, Channel channel){
        System.out.println("receive message sms inform "+msg);
    }
}
